<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<title>Choose Database Dialog Box</title>
<link rel="stylesheet" href="ide.css" title="Oracle BLAFDoc" type="text/css"/>
</head>

<body>
<p><a id="org.netbeans.modules.j2ee.ejbcore.ui.logicalview.entries.SelectDatabasePanel" name="org.netbeans.modules.j2ee.ejbcore.ui.logicalview.entries.SelectDatabasePanel"></a></p>
<div id="NBCSH4661"><!-- infolevel="all" infotype="General" --><a id="sthref671" name="sthref671"></a>
<h1>Choose Database Dialog Box</h1>
<a name="BEGIN" id="BEGIN"></a>
<p>You use this dialog box to add code to a Java class file that looks up a networked database. You can choose to specify an existing class containing the lookup code or the IDE can generate the lookup code for you. The lookup code uses a reference name that refers to the JNDI name of your data resource. If there is no reference name associated with your data resource, you can create a new reference name in the dialog box.</p>
<p>You can only insert database look-up code in Java classes that are located in an EJB module project or web application project.</p>
<p>Use the dialog box as follows:</p>

<table summary="User interface elements and descriptions" dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
<col width="24%" />
<col width="*" />
<thead>
<tr align="left" valign="top">
<th align="left" valign="bottom" id="r1c1-t37">Element</th>
<th align="left" valign="bottom" id="r1c2-t37">Description</th>
</tr>
</thead>
<tbody>
<tr align="left" valign="top">
<td align="left" id="r2c1-t37" headers="r1c1-t37">Reference</td>
<td align="left" headers="r2c1-t37 r1c2-t37">Select the name of the resource reference from the drop-down list. The resource reference refers to the JNDI name of the data source you want to use. If no resource reference to your data source is available in the drop-down list, click Add to create a new reference name.</td>
</tr>
<tr align="left" valign="top">
<td align="left" id="r3c1-t37" headers="r1c1-t37">
<p>Service Locator Strategy</p>
</td>
<td align="left" headers="r3c1-t37 r1c2-t37">Choose to generate inline lookup code or use an existing class. You can click <b>Browse</b> to search for the existing class names. 
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
<param name="content" value="http://www.oracle.com/pls/topic/lookup?ctx=nb8200&id=NBDAG2709">
<param name="text" value="<html><u>How?</u></html>">
<param name="textFontSize" value="medium">
<param name="textColor" value="blue">
</object>
</td>
</tr>
</tbody>
</table>
<br />
<!-- -->
<p><b>Note</b>: When you create a new reference name for a data source you need to choose a data source in your project or on the server. If the data source does not exist, you must create the data source by specifying the JNDI name and database connection for the data source.</p>
<a id="NBCSH4663" name="NBCSH4663"></a>
<hr><p><b>Related Topics</b></p>
<p><i>Developing Applications with NetBeans IDE</i>, 
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
<param name="content" value="http://www.oracle.com/pls/topic/lookup?ctx=nb8200&id=NBDAG2700">
<param name="text" value="<html><u>&quot;Creating an Enterprise Bean&quot;</u></html>">
<param name="textFontSize" value="medium">
<param name="textColor" value="blue">
</object>
</p>
<p><i>Developing Applications with NetBeans IDE</i>, 
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
<param name="content" value="http://www.oracle.com/pls/topic/lookup?ctx=nb8200&id=NBDAG1821">
<param name="text" value="<html><u>&quot;Setting Up a Database Connection&quot;</u></html>">
<param name="textFontSize" value="medium">
<param name="textColor" value="blue">
</object>
</p>
<p><i>Developing Applications with NetBeans IDE</i>, 
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
<param name="content" value="http://www.oracle.com/pls/topic/lookup?ctx=nb8200&id=NBDAG1681">
<param name="text" value="<html><u>&quot;Working with Glassfish Application Servers&quot;</u></html>">
<param name="textFontSize" value="medium">
<param name="textColor" value="blue">
</object>
</p>
<p><i>Developing Applications with NetBeans IDE</i>, 
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
<param name="content" value="http://www.oracle.com/pls/topic/lookup?ctx=nb8200&id=NBDAG1651">
<param name="text" value="<html><u>&quot;About Working with Web Application Servers&quot;</u></html>">
<param name="textFontSize" value="medium">
<param name="textColor" value="blue">
</object>
</p>

<!-- -->
<!-- Start Footer -->


<table summary="" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left" width="86%"><a href="legal_notice.htm">
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0.</a>
</td>
</tr>
</table>
<!-- -->
</body>
</html>
